<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/WEB-INF/struts-tags.tld"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> 

<%@ page import="java.io.InputStream" %>
<%@ page import="java.io.IOException" %>
<%@ page import="java.util.Properties" %>
<%@ page import="cn.ffcs.security.model.User" %>
<%@ page import="cn.ffcs.security.web.UserContext" %>
<%
 User user=((UserContext)session.getAttribute("LOGINUSER_CONTEXT")).getCurrUser();
 Properties prop = new Properties(); 
 InputStream in = null; 
 String url="";
 try { 
     in=this.getClass().getResourceAsStream("/sp-server.properties");
     prop.load(in); 
     url=prop.getProperty("contract.server.url");
 } catch (IOException e) { 
     e.printStackTrace(); 
 } finally{
     if (in != null) {
         try {
             in.close();
         } catch (Exception e) {
         }
     }
 }

 %>
 
 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>欢迎访问产品运营互动中心！</title>

<script src="<s:url value="/script/jquery/lib/jquery-1.4.2.min.js"/>" type="text/javascript"></script>
<script src="<s:url value="/script/formValidator.js"/>" type="text/javascript" charset="UTF-8"></script>
<script src="<s:url value="/script/formValidatorRegex.js"/>" type="text/javascript" charset="UTF-8"></script>
<script language="javascript" src="<s:url value="/script/DateTimeMask.js"/>" type="text/javascript"></script>
<script type="text/javascript" src="<s:url value="/components/My97DatePicker/WdatePicker.js"/>"></script>
<script type="text/javascript" src="<s:url value="/script/selfResize.js"/>"></script>

<script type="text/javascript" src="<s:url value="/script/jquery/jquery-ui-1.8.2/js/jquery-ui-1.8.2.custom.min.js"/>"></script>
<script type="text/javascript">

$(document).ready(function(){
	$("#tabs").tabs();
	$("input[type='radio']").click(function(){
		value=$(this).val();
		name=$(this).attr('name');
		name=name.substr(0,7);
		if(value=='01'){
			$('#'+name+'Time01').show();
			$('#'+name+'Time02').hide();
		}else{
			$('#'+name+'Time01').hide();
			$('#'+name+'Time02').show();
		}
	});
	
	$.formValidator.initConfig({autotip:true,onerror:function(msg){alert(msg)}});
	$("select[name='contractInfo.referenceType.id']").formValidator({tipid:"referenceTypetip",onshow:"资料类型"}).inputValidator({onerror:"您还没有输入资料类型",empty:{leftempty:false,rightempty:false,emptyerror:"资料类型不能为空"}});
	$("input:text[name='contractInfo.title']").formValidator({tipid:"titletip",onshow:"标题"}).inputValidator({min:1,onerror:"您还没有输入标题",empty:{leftempty:false,rightempty:false,emptyerror:"标题两边不能有空符号"}});
	$("textarea[name='contractInfo.content']").formValidator({tipid:"contenttip",onshow:"内容"}).inputValidator({min:1,max:300,onerror:"您输入的描述长度不正确,请确认"});
	$("input:text[name='contractInfo.keyword']").formValidator({tipid:"keywordtip",onshow:"关键字"}).inputValidator({min:1,onerror:"您还没有输入资料关键字",empty:{leftempty:false,rightempty:false,emptyerror:"关键字两边不能有空符号"}});
	
});
</script>

<script type="text/javascript">
function show(url){
	window.open(url);
}
function initLoad(){
	f_iframeResize();
}
window.onload = initLoad;
</script>

<link rel="stylesheet" href="<s:url value="/css/style_new.css"/>">
<link rel="stylesheet" href="<s:url value="/css/validator.css"/>">

<link href="<s:url value="/images/08_ccxxzx.css"/>" rel="stylesheet" type="text/css" />
<link href="<s:url value="/script/jquery/jquery-ui-1.8.2/css/redmond/jquery-ui-1.8.2.custom.css"/>" rel="stylesheet" type="text/css" />
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0">
<table width="980" border="0" cellspacing="0" cellpadding="0" align="center">
		<tr>
			<td>
			<table width="100%" border="0" cellpadding="0" cellspacing="0"
				background="<s:url value="/images/new/gxzl_index_2.gif"/>">
				<tr>
					<td width="20" height="32">&nbsp;</td>
					<td width="20"><img
						src="<s:url value="/images/new/dq_dot.gif"/>" width="15"
						height="12" /></td>
				<td>当前位置：<font color="#003399">合同管理</font>&gt;&gt;合同归档</td>
				</tr>
			</table>
			</td>
		</tr>
	
	<tr>
		<td background="<s:url value="/images/home_4a.gif"/>">
		<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
			<tr>
		    <td  background="<s:url value="/images/home_4a.gif"/>"> 
		      <table width="100%" height="400" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
		        <tr>
		          <td width="240" valign="top" class="leftbg">
					<%@ include file="/commons/include/contract_left.inc"%>  
				  </td>
		          <td valign="top">
						<s:form name="form1" id="form1" onsubmit="submit1()" action="saveContractInfo.action?isRemind=true" namespace="/security" method="post" enctype="multipart/form-data" >
							<input type="hidden" name="contractInfo.id" value="${contractInfo.id}">
							<table width="98%" align="center" border="0" cellspacing="0" cellpadding="0">
								<br/>
								<tr>
									<td height="5">
										<table width="100%" border="0" cellspacing="0" cellpadding="0">
											<tr>
												<td width="5" height="5"><img src="<s:url value="/images/cphdzx_tab1.gif"/>" width="5" height="5" /></td>
												<td class="tdborderup"><img src="<s:url value="/images/spacer.gif"/>" width="1" height="1" /></td>
												<td width="5"><img src="<s:url value="/images/cphdzx_tab2.gif"/>" width="5" height="5" /></td>
											</tr>
										</table>
									</td>
								</tr>
								<tr>
									<td  class="tdborderleftright">
									<TABLE width="98%" cellSpacing=1 cellPadding=0 align="center">
										<TR height=30>
											<TD align=left width="10%">
												<c:if test="${param.isEdit=='true'}">
												<input type="submit" IsShowProcessBar="True" name="Submit" value="提 交">
												</c:if>
												<input type="button" value="返 回" onClick="window.history.back();">
											</TD>
										</TR>
									</table>
									<s:if test="#returnMsg==null">
									</s:if> <s:else>
										<TABLE width="98%" cellSpacing=1 cellPadding=0 align="center">
											<TR height=30>
												<TD align=left width="10%"><font color="red">${returnMsg}</font>
												</TD>
											</TR>
										</table>
									</s:else>

								<div id="tabs">
									<ul>
										<li><a href="#tabs-1">基本信息</a></li>
										<li><a href="#tabs-2">附件信息</a></li>
										<li><a href="#tabs-3">特殊条件约束</a></li>
									</ul>
									<div id="tabs-1">

									<table width="92%" border="0" cellspacing="0" cellpadding="7" align="center" class=tablecolor2>
										<tr>
											<td width="23%" bgcolor="D6E3FA">
											<div align="right"><font color="red">*</font>合同名称：</div>
											</td>
											<td width="77%"><s:textfield name="contractInfo.contractName" theme="css_xhtml" cssStyle="width:98%"/></td>
										</tr>
										<tr>
											<td width="23%" bgcolor="D6E3FA">
											<div align="right">产品类别：</div>
											</td>
											<td width="77%">
												<s:select name="contractInfo.contractType.id" list="contractTypes" listKey="id" listValue="name" theme="css_xhtml" />
											</td>	
										</tr>
										<tr>
											<td width="23%" bgcolor="D6E3FA">
											<div align="right">正式合同编号：</div>
											</td>
											<td width="77%"><s:textfield name="contractInfo.serial" theme="css_xhtml" size="33"/></td>
										</tr>
										<tr>
											<td width="23%" bgcolor="D6E3FA">
											<div align="right">会签编号：</div>
											</td>
											<td width="77%"><s:textfield name="contractInfo.signCode" theme="css_xhtml" size="33"/>
												<s:if test="contractInfo.signCode!=null">
													<a href="javascript:void(0);" onClick="contractDetail();">
														查看合同详情</a>
												</s:if>
											</td>
										</tr>
										<tr>
											<td width="23%" bgcolor="D6E3FA">
											<div align="right">签约方公司名称：</div>
											</td>
											<td width="77%"><s:textfield name="contractInfo.signatoriesName" theme="css_xhtml" cssStyle="width:98%"/></td>
										</tr>
										<tr>
											<td width="23%" bgcolor="D6E3FA">
											<div align="right">第三方名称：</div>
											</td>
											<td width="77%"><s:textfield name="contractInfo.thirdName" theme="css_xhtml" cssStyle="width:98%"/></td>
										</tr>
										<tr>
											<td width="23%" bgcolor="D6E3FA">
												<div align="right">合同起草人：</div>
											</td>
											<td width="77%"><input name="contractInfo.creatorName" value="${contractInfo.creatorName}" size="33" readonly/></td>
										</tr>
										<tr>
											<td width="23%" bgcolor="D6E3FA">
											<div align="right">合同金额：</div>
											</td>
											<td width="77%"><s:textfield name="contractInfo.amount" theme="css_xhtml" size="33"/></td>
										</tr>
										<tr>
											<td width="23%" bgcolor="D6E3FA">
											<div align="right">合同状态：</div>
											</td>
											<td width="77%">
												<select name="contractInfo.status" >
													<option value="0">起草</option>
													<option value="1">会签</option>
													<option value="2" selected>归档</option>
												</select>
											</td>
										</tr>
										<tr>
											<td width="23%" bgcolor="D6E3FA">
											<div align="right">生效时间：</div>
											</td>
											<td width="77%">
												<input type="text" name="contractInfo.effectTime" class="Wdate" style="height:22px;width: 120px"
												 onFocus="WdatePicker({isShowClear:true,readOnly:true})" value="<s:date name="contractInfo.effectTime" format="yyyy-MM-dd" />" />
											</td>
										</tr>
										<tr>
											<td width="23%" bgcolor="D6E3FA">
											<div align="right">到期时间：</div>
											</td>
											<td width="77%">
												<input type="text" id="maturityTime" name="contractInfo.maturityTime" class="Wdate" style="height:22px;width: 120px"
												 onFocus="WdatePicker({isShowClear:true,readOnly:true})" value="<s:date name="contractInfo.maturityTime" format="yyyy-MM-dd" />" />
											</td>
										</tr>
										<tr>
											<td width="23%" bgcolor="D6E3FA">
											<div align="right">是否顺延：</div>
											</td>
											<td width="77%">
												<select name="contractInfo.postpone" onchange="chick(this);">
													<option value="否" <s:if test='contractInfo.postpone == "否"'>selected</s:if> >否</option>
													<option value="是" <s:if test='contractInfo.postpone == "是"'>selected</s:if> >是</option>
													
												</select>
											</td>
										</tr>
										<tr>
											<td width="23%" bgcolor="D6E3FA">
											<div align="right">顺延时间：</div>
											</td>
											<td width="77%">
												<input type="text" id="postponeTime" name="contractInfo.postponeTime" class="Wdate" style="height:22px;width: 120px"
												 onFocus="WdatePicker({isShowClear:true,readOnly:true})" value="<s:date name="contractInfo.postponeTime" format="yyyy-MM-dd" />" />
											</td>
										</tr>
										<tr>
											<td width="23%" bgcolor="D6E3FA">
											<div align="right">对方联系人：</div>
											</td>
											<td width="77%"><s:textfield name="contractInfo.contact" theme="css_xhtml" size="33"/></td>
										</tr>
										<tr>
											<td width="23%" bgcolor="D6E3FA">
											<div align="right">联系电话：</div>
											</td>
											<td width="77%"><s:textfield name="contractInfo.contactTel" theme="css_xhtml" size="33"/></td>
										</tr>
										<tr>
											<td width="23%" bgcolor="D6E3FA">
											<div align="right">合作内容：</div>
											</td>
											<td width="77%"><s:textfield name="contractInfo.hezuoContent" theme="css_xhtml" cssStyle="width:98%"/></td>
										</tr>
										<tr>
											<td width="23%" bgcolor="D6E3FA">
											<div align="right">合作内容简要说明：</div>
											</td>
											<td width="77%">
													<s:textarea rows="3" cols="60" name="contractInfo.hezuoContentInfo" theme="css_xhtml" cssStyle="width:98%"></s:textarea>
											</td>
										</tr>
										<tr>
											<td width="23%" bgcolor="D6E3FA">
											<div align="right">合作模式：</div>
											</td>
											<td width="77%"><s:textfield name="contractInfo.hezuoMode" theme="css_xhtml" size="33"/></td>
										</tr>
										<tr>
											<td width="23%" bgcolor="D6E3FA">
											<div align="right">合作模式具体说明：</div>
											</td>
											<td width="77%">
													<s:textarea rows="3" cols="60" name="contractInfo.hezuoModeInfo" theme="css_xhtml" cssStyle="width:98%"></s:textarea>
											</td>
										</tr>
										<tr>
											<td width="23%" bgcolor="D6E3FA">
											<div align="right">备注：</div>
											</td>
											<td width="77%">
													<s:textarea rows="3" cols="60" name="contractInfo.notes" theme="css_xhtml" cssStyle="width:98%"></s:textarea>
											</td>
										</tr>
						
					 					<tr>
											<td width="23%" bgcolor="D6E3FA">
											<div align="right">特殊约束条款：</div>
											</td>
											<td width="77%">
												<s:textarea rows="3" cols="60" name="contractInfo.condInfo" theme="css_xhtml" cssStyle="width:98%"></s:textarea>
											</td>
										</tr>

										<s:if test="contractInfo.id>0">
										<tr>
											<td width="23%" bgcolor="D6E3FA">
											<div align="right">处理意见：</div>
											</td>
											<td width="77%">
													<s:textarea rows="3" cols="60" name="contractRecord.advice" theme="css_xhtml" cssStyle="width:98%"></s:textarea>
											</td>
										</tr>
					 					</s:if>
										
										<!-- 
										<tr>
											<td width="23%" bgcolor="D6E3FA">
											<div align="right">传送人员：</div>
											</td>
											<td width="77%">
											<s:iterator value="processors" status="st">
													<input type="checkbox" name="nextTo" value="<s:property value="name" />" checked><s:property value="name" />
											</s:iterator>
											</td>
										</tr>
										 -->
										<input type="hidden" name="contractInfo.advice" value="${contractInfo.advice}"/>
										<input type="hidden" name="contractInfo.nextUser" value="${contractInfo.nextUser}"/>
										<input type="hidden" name="contractInfo.creator" value="${contractInfo.creator}">
										<input type="hidden" name="contractInfo.createTime" value="<s:date name="contractInfo.createTime" format="yyyy-MM-dd HH:mm"/>">
										<input type="hidden" name="contractInfo.submitTime" value="<s:date name="contractInfo.submitTime" format="yyyy-MM-dd HH:mm"/>">
										<input type="hidden" name="contractInfo.begin" value="<s:date name="contractInfo.begin" format="yyyy-MM-dd HH:mm"/>">
										<input type="hidden" name="contractInfo.end" value="<s:date name="contractInfo.end" format="yyyy-MM-dd HH:mm"/>">
										<input type="hidden" name="flag" value="archive">
										<input type="hidden" name="contractInfo.version" value="${contractInfo.version}">
										<input type="hidden" name="contractInfo.arrivalTime" value="${contractInfo.arrivalTime}">
										<input type="hidden" name="contractInfo.processTime" value="${contractInfo.processTime}">
										
									</table>
									<br>[以下为处理流程]<br>
									
									<table width="92%" border="0" cellspacing="0" cellpadding="7" align="center" class=tablecolor2>
										<s:iterator value="contractRecords" status="st">
											<tr>
												<td width="100%" colspan="2">操作者:<s:property value="creatorName" /> <s:date name="begin" format="yyyy-MM-dd HH:mm"/></td>
											</tr>
											<tr>
												<td width="18%">
												<div>处理意见</div>
												</td>
												<td width="*"><s:property value="advice" /></td>
											</tr>
										</s:iterator>
									</table>


										
									</div>
									
									<div id="tabs-2">
										<table width="92%" border="0" cellspacing="0" cellpadding="7" align="center" class=tablecolor2>

										<tr>
											<td width="19%" bgcolor="D6E3FA">
												<div align="right" class="STYLE2">
													附&nbsp;&nbsp;&nbsp;&nbsp;件：
												</div>
											</td>
											<td width="81%">
												<table width="100%" border="0" class=tablecolor2>
													<tr>
														<td width="" align="center" bgcolor="D6E3FA">
															附件名称
														</td>
														<td width="50" align="center" bgcolor="D6E3FA">
															删除
														</td>
													</tr>
													
													<c:forEach var="upload" items="${contractUploads}">
														<input type="hidden" name="attachIDs"
															value="<s:property value="id" />" />
														<tr>
															<td>
																<a href="/business/contract/showUpload.action?id=${upload.id}" target="_blank"> ${upload.fileName }</a>
															</td>
															<td align="center">
																<input type="checkbox" name="delIDs"
																	value="${upload.id}">
															</td>
														</tr>
													</c:forEach>
												</table>
												<br />
												<table width="100%" border="0" class=tablecolor2>
													<tr>
														<td width="" colspan="2" align="left"
															bgcolor="D6E3FA">
															附件上传
														</td>
													</tr>
													<tr>
														<td width="10px">
															&nbsp;
														</td>
														<td align="left">
															<input type="file" name="upload" size="60" />
														</td>
													</tr>
													<tr>
														<td>
															&nbsp;
														</td>
														<td>
															<input type="file" name="upload" size="60" />
														</td>
													</tr>
													<tr>
														<td>
															&nbsp;
														</td>
														<td>
															<input type="file" name="upload" size="60" />
														</td>
													</tr>
												</table>
											</td>
										</tr>	
										
										</table>
									
									</div>									
									
									<div id="tabs-3">
										<table width="92%" border="0" cellspacing="0" cellpadding="7" align="center" class=tablecolor2>
										<c:forEach items="${listRemind}" var="listone" varStatus="j">
										
										<tr>
											<td width="23%" bgcolor="D6E3FA">
											<div align="right">特殊约束条件${j.index+1 }：</div>
											</td>
											<td width="77%">
												<input type="hidden" name="remind{j.index+1 }.id" value="${listone.id}">
												<textarea rows="3" cols="60" name="remind${j.index+1 }.condNote" theme="css_xhtml" style="width: 98%">${listone.condNote}</textarea>
											</td>
										</tr>
										<tr>
											<td width="23%" bgcolor="D6E3FA">
											<div align="right">提醒时间${j.index+1 }：</div>
											</td>
											<td width="77%" style="height: 90px;vertical-align: top;">
												<div>
													
													<input type="radio" id="" name="remind${j.index+1 }.timeType" value="01" <c:if test="${listone.timeType!='02'}">checked="checked"</c:if>/>单次提醒时间
													<input type="radio" name="remind${j.index+1 }.timeType" value="02" <c:if test="${listone.timeType=='02'}">checked="checked"</c:if>/>周期提醒时间												
												</div>

												<div id="remind${j.index+1 }Time01" style="margin-top: 5px;<c:if test="${listone.timeType!='01'}">display: none;</c:if>">
												提醒时间：<input type="text" name="remind${j.index+1 }.condTime" class="Wdate" style="height:22px;width: 120px"
												 onFocus="WdatePicker({isShowClear:true,readOnly:true})" value="<fmt:formatDate value='${listone.condTime}' pattern='yyyy-MM-dd' />" />
												
												</div>
												
												<div id="remind${j.index+1 }Time02" style="margin-top: 5px;<c:if test="${listone.timeType!='02'}">display: none;</c:if>">
												开始时间：<input type="text" name="remind${j.index+1 }.startTime" class="Wdate" style="height:22px;width: 120px"
												 onFocus="WdatePicker({isShowClear:true,readOnly:true})" value="<fmt:formatDate value='${listone.startTime}' pattern='yyyy-MM-dd' />" />
												结束时间：<input type="text" name="remind${j.index+1 }.endTime" class="Wdate" style="height:22px;width: 120px"
												 onFocus="WdatePicker({isShowClear:true,readOnly:true})" value="<fmt:formatDate value='${listone.endTime}' pattern='yyyy-MM-dd' />" /><br/>
												定期模式：每个月的第<input name="remind${j.index+1 }.monDay" type="text" style="width: 30px" value="${listone.monDay}"/>天
												</div>
												
											</td>
										</tr>
										</c:forEach>
																			
										</table>
									</div>
								</div>
								
									</td>
								</tr>
								
								<tr>
									<td height="5">
										<table width="100%" border="0" cellspacing="0" cellpadding="0">
											<tr>
												<td width="5" height="5"><img src="<s:url value="/images/cphdzx_tab3.gif"/>" width="5" height="5" /></td>
												<td class="tdborderbottom"><img src="<s:url value="/images/spacer.gif"/>" width="1" height="1" /></td>
												<td width="5"><img src="<s:url value="/images/cphdzx_tab4.gif"/>" width="5" height="5" /></td>
											</tr>
										</table>
									</td>
								</tr>
							</table></td>
					</tr>
				</table>
				</s:form> 
</body>
</html>
<script type="text/javascript">
function submit1(){
	

	document.all['contractInfo.effectTime'].value+=" 00:00:00";

	document.all['contractInfo.maturityTime'].value+=" 00:00:00";

	document.all['contractInfo.postponeTime'].value+=" 00:00:00";
	
}
function chick(o){
	var maturityTime=document.getElementById("maturityTime");
	var postponeTime=document.getElementById("postponeTime");
	if(o.value=="否"){
		postponeTime.value=maturityTime.value;
		postponeTime.readOnly='readOnly';
		//postponeTime.onfocus=null;
	}else{
		//postponeTime.focus()="WdatePicker({isShowClear:true,readOnly:true})";
	}
}
function contractDetail(){
    //var url="<%=url%>?userID=FJYANGSB&userID_s=(7018AE61F8D96971BA210C575547D588)&redirectUrl=contract/contractLoadAction.do?act=${actContract.act}&frameFlag=${actContract.frameFlag}&companyFlag=${actContract.companyFlag}&currDept=${actContract.currDept}&signCode=${actContract.signCode}";
    var url="<%=url%>?userID=${actContract.userId}&userID_s=${actContract.userMk}&redirectUrl=contract/contractLoadAction.do?act=${actContract.act}&frameFlag=${actContract.frameFlag}&companyFlag=${actContract.companyFlag}&currDept=${actContract.currDept}&ID=${actContract.contractID}";
    //prompt("123",url);
    window.open(url,null,"height=700,width=1020,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes");
}

var obj1=document.getElementById("iTR6");
if(obj1){
	obj1.style.backgroundColor="B3DEF4";
}
</script>